All Questions
17 questions
-1votes
1answer
59views
BASH SCRIPT: Echo to file is transfered to remote host [closed]
I am writing a bash script in order to perform some automatic backups to a remote storage server. The batch script will be run with cron jobs however I'm testing it before. See script below: #!/bin/...
0votes
0answers
32views
scp returns No such file or directory in script but executes when run manually [duplicate]
For context, I need to use a custom command to build an identity file so I can ssh successfully. I've renamed it because it's an internal tool and want to avoid NDA issues. You can consider it as a ...
0votes
1answer
25views
Two versions of same script on server/weird behavior
I uploaded a bash script to my vps using scp. Then I changed a line locally, deleted it on the server and uploaded it again to the home directory. Now I'm facing this extremely weird behavior: If I ...
1vote
2answers
3kviews
Why doesn't SCP accept the username/hostname combination, when it's accepted by SSH?
I use ssh to login to Linux hosts through CyberArk, which is the reason for the username/hostname combination: DB6164@DB6164CP#[email protected]#[email protected] The following ...
0votes
3answers
6kviews
Variable for SCP command in script
I'm trying to write a script that will check what is the last modified/created file on the server, then copy it to my homedirectory on this server and then copy this file from node to my local machine....
3votes
1answer
1kviews
Using local system's .bash_profile and .vimrc on remote systems
Risking asking a possibly duplicate here but could not get any relevant answers. I wish to use my local system's .bash_profile and .vimrc on all the remote hosts I log in to. Is there an easy way to ...
1vote
0answers
1kviews
scp attempt in a bash script triggered by cron fails; works when run script manually
Trying to scp a file in a bash script that's scheduled by cron. When cron triggers it, the scp fails with a permission denied error message. When I run the script manually using a command like: /...
2votes
1answer
15kviews
How to copy the files from remote unix server to local windows? [duplicate]
I have my working system in a remote location and the os is in unix and i need to get the files from that remote unix system to my local machine using bash commands. I tried scp ls .txt* D:\BACKUP ...
6votes
1answer
17kviews
specify shell for ssh session
I am logging to a remote server via ssh as user www-data. User www-data on the server has his default shell set to /bin/sh, and when I log in, I get dash as my shell. I can then type bash and get bash ...
1vote
1answer
480views
Concat all remotely distributed files in your cluster
I want to concatenate all abc_2015-12-15.txt files present on my cluster.Is there any best way to achieve this ? One way is to use below command across all nodes till all files concatenated :- ssh ...
1vote
2answers
2kviews
bash scripting : using expect
I am facing an issue when I run simply these commands. The remote server want to pass "yes" to add the key in RSA file because first time connection established with scp. commands are given below #!...
3votes
3answers
8kviews
How to copy, execute and retrieve data from a remote computer?
I am trying to run some calculations on a remote computer. Basically I want to copy some files to the computer, load a software, execute the calculation, then retrieve the data back. I have created a ...
0votes
2answers
989views
When executing a script via ssh, how can I transfer variables back to the PC issuing the cmd?
I'm writing a pretty simple script that will SSH into the machine of my choice, run a script to obtain things like the number of users logged in, CPU averages, etc, and write it to a file on the PC ...
8votes
5answers
129kviews
How to copy a file from a remote network to the local desktop
So I used SSH to remotely login to another computer on a network. I have many files that I would like to copy over to my local desktop. I am trying to follow this How-to : However, I think one of ...
93votes
11answers
100kviews
Autocomplete server names for SSH and SCP
I have a few servers configured in ~/.ssh/config, such as alpha and beta. How might I configure Bash such that the commands $ ssh alTab and $ scp file.tgz alTab autocomplete the names of the ...